
public class P39 {
	public static void main(String[] args) {
		int max = 0;
		int number = 0;
		
		for (int n = 1; n <= 1000; n++) {
			//System.out.println(n);
			int result = 0;
			for (int a = 1; a <= n; a++) {
				for (int b = 1; b <= n - a; b++) {
					for (int c = 1; c <= n - a - b; c++) {
						if (a + b + c == n) {
							if (a * a + b * b == c * c) {
								result++;
							}
						}
					}
				}
			}
			
			if (max < result) {
				//System.out.println(max);
				max = result;
				number = n;
			}
		}
		
		System.out.println();
		System.out.println(number);
		System.out.println(max);
	}
}
